﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using D2.Pathfinder.Data;
using System.Xml.Serialization;
using System.IO;

namespace TestingPathfinder.Data
{
    class Program
    {
        static void Main(string[] args)
        {
            Settings set = new Settings();
            set.Alignments.Add(new AlignmentDef() { Key = "CE", Description = "Doing everything with evil intent", Name = "Chaotic Evil" });
            set.Classes.Add(new ClassDef() { Key = "MNK", Name = "Monk", Descriptoin = "A spiritual being with the power of an ox." });
            set.Currencies.Add(new CurrencyDef() { Key = "GLD", Name = "Gold", Description = "A sparkling yellow substance traded by almost everyone." });
            set.Deities.Add(new DeityDef() { Key = "God", Name = "God", Description = "" });
            set.Feats.Add(new FeatDef() { Key = "ImprovedCrit", Name = "Improved Critical", Description = "Expands the posibility of critical hits." });
            set.Genders.Add(new GenderDef() { Key = "M", Name = "Male", Description = "Has a penis." });
            set.Items.Add(new ItemDef() { Key = "Arrow", Name = "Arrow", Description = "A simple arrow, wooden shaft and stone tip.", Weight=.01 });
            set.Languages.Add(new LanguageDef() { Key = "Common", Name = "Common", Description = "Spoken by everyone." });
            set.Races.Add(new RaceDef() { Key = "Human", Name = "Human", Description = "A basic race of primitive people." });
            set.Resources.Add(new ResourceDef() { Key = "Ki", Name = "Ki", Description = "The inner energy of the body." });
            set.Sizes.Add(new SizeDef() { Key = "Med", Name = "Medium", Description = "Not large and not small, but somewhere in between." });
            set.Skills.Add(new SkillDef() { Key = "Acrobatics", Name = "Acrobatics", Description = "Increases the nimbility at which the character jumps.", Mod = "DEX" });
            set.Spells.Add(new SpellDef() { Key = "KiArrow", Name = "Ki Arrow", Description = "Charge an arrow with Ki energy and throw it at a target. Arrow fires straight every time." });
            set.Characters.Add(new Character()
            {
                Alignment = "CE",
                AC = new ACGroup() { Base = new List<ModType>() { new ModType() { Mod = "DEX", Variable = "Rating" } } },
                Age = 22,
                Attack = new BasedModList() { Base = 2, Modifier = new List<ModType>() { new ModType() { Mod = "STR", Variable = "Rating" } } },
                BagOfHolding = new ItemList() { MaxCapacity = 200, Item = new List<Item>() { new Item() { Key = "Arrow", Quantity = 100 } } },
                Classes = new List<Class>() { new Class() { Key = "MNK", Level = 5, Preferred = true } },
                CMB = new List<ModType>() { new ModType() { Mod = "DEX", Variable = "Rating" } },
                CMD = new List<ModType>() { new ModType() { Mod = "STR", Variable = "Rating" } },
                CoinPurse = new List<Currency>() { new Currency() { Key = "GLD", Amount = 500, AmountSpecified = true } },
                Deity = "God",
                Eyes = "(0,150,255)",
                Feats = new List<Feat>() { new Feat() { Key = "ImprovedCrit" } },
                Gender = "M",
                Hair = "(130,150,150)",
                Height = "5'11\"",
                HP = 40,
                Initiative = new List<ModType>() { new ModType() { Mod = "DEX", Variable = "Rating", Shift = 2 } },
                Languages = new List<Language>() { new Language() { Key = "Common" } },
                MaxHP = 41,
                Name = "Blaak",
                Player = "Blake",
                Race = "Human",
                Resources = new List<Resource>() { new Resource() { Key = "Ki", Max = 9, Remaining = 8 }},
                Saves = new List<SavingThrow>() { new SavingThrow() { Key = "Will", Description = "Something", Name = "Will" } },
                Size = "Med",
                Skills = new List<Skill>() { new Skill() { Key = "Acrobatics", Ranks = 3, Trained = true, Modifier = new List<ModType>() { new ModType() { Shift = 3 } } } },
                Spellbook = new List<Spell>() { new Spell() { Key = "KiArrow", Resource = "Uses", Uses = 3 } },
                SpellResistance = new BasedModList() { Base = 0, Modifier = new List<ModType>() { new ModType() { Shift = 3 } } },
                Stats = new List<StatType>() { new StatType() { Key = "STR", Value = 19, Rating = 4 }, new StatType() { Key = "DEX", Rating = 1, Value = 12}},
                Weapons = new List<HeldWeapon>() { new HeldWeapon() { Name = "Fists", CriticalRange = "20", Damage = "1d8+4", Range = 0, Equipped = true, Description = "My fists, bitch."}},
                Weight = 200
            });
            XmlSerializer ser = new XmlSerializer(typeof(Settings));
            ser.Serialize(new StreamWriter("../../test.xml"), set);
        }
    }
}
